#include <iostream>
using namespace std;
typedef struct Node{
	int val;
	struct Node* before;
	struct Node* next;
	Node(int val,struct Node* before,	struct Node* next){
		this->val = val;
		this->before = before;
		this->next = next;  
	}
}Node;
void show(Node *head){//传入的是head 
	if (head==NULL) return;//空 
	if (head->next==head->before){
		cout<<head->val<<endl;
		return;//只有一个元素 
	}
	Node *cur = head; 
	while(cur->next!=head){
		cout<<cur->val<<" ";
		cur = cur->next;
	}
	//到了最后一个node，单独处理 
	cout<<cur->val<<endl;
}
int n,pos,over;
void init(Node * &head,int n){
	//创建一个含有n个元素的双链表
	head = new Node(1,head,head);
	Node *cur = head;
	 for(int i=2;i<=n;i++){
	 	Node *temp = new Node(i,cur,head);  
	 	cur->next = temp;
	 	cur = temp;
	 }
	 head->before = cur;//把第一个节点的before改为最后一个元素 
//	show(head);
}

int main()
{

 cin>>n>>pos>>over;
 Node *head;
 init(head,n);
  

 Node* cur = head;
 int left = n;
 int curpos = 1;
 //把cur移动到pos处
while(curpos!=pos){
	cur = cur->next;
	curpos++;  
} 

 while(left!=0){
	//移除此人
	int crow = 1;
	while(crow!=over){
		cur = cur->next;
		crow++;
	}
	//cur要移除
	Node *temp = cur;
	temp->before->next = cur->next;
	cur->next->before = temp->before;
	cur = cur->next;
	cout<<temp->val<<endl;
	delete temp;
	left--;
 }
 
  return 0;
}